﻿class ExternalSound extends ManagedSound {
	var _file:String;
	var _loaded:Boolean;
	var _startOnLoad:Boolean;
	
	function ExternalSound(file:String) {
		super();
		_file = file;
		_loaded = false;
		_startOnLoad = false;
		this.loadSound(file, true);
	}
	
	function onLoad():Void {
		_loaded = true;
		if (_startOnLoad) {
			super.start();
		}
	}
	
	function start():Void {
		if (_loaded) {
			super.start();
		} else {
			_startOnLoad = true;
		}
	}
}
